import { createI18n } from 'vue-i18n'

import el_zh_cn from 'element-plus/es/locale/lang/zh-cn'
import el_en from 'element-plus/es/locale/lang/en'

import zh_cn from "./lang/zh-cn";
import en from "./lang/en";

const messages = {
    "zh-CN": {
        el: el_zh_cn,
        ...zh_cn,
    },
    "en-US": {
        el: el_en,
        ...en,
    },
};


const i18n = createI18n({
    // something vue-i18n options here ...
    locale: localStorage.getItem('vue-language') || localStorage.getItem('lang') || "zh-CN",
    fallbackLocale: "zh-CN",
    globalInjection: true,
    legacy: false,
    messages,
    silentFallbackWarn: true,
    silentTranslationWarn: true //去除警告信息
})

export default i18n